<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>患者列表</title>
    <link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/bootstrap.css"/>
<link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/icheck.css"/>
<script src="/WebYiZhi/Template/Home/Js/jquery-2.1.1.js"></script>
<script src="/WebYiZhi/Template/Home/Js/bootstrap.js"></script>
<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/jquery.form/3.46.0/jquery.form.js"></script>
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js"></script>
<script>DD_belatedPNG.fix('.pngfix,.icon');</script>
<![endif]-->
<!--[if lt IE 9]>
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>

<![endif]-->
<script src="/WebYiZhi/Public/layer/layer.js"></script>
<!--自己的css-->
<link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/login.css"/>
<link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/style.css"/>
<script src="/WebYiZhi/Template/Home/Js/message.js"></script>
<script type="text/javascript" src="/WebYiZhi/Template/Home/Js/Validform_v5.3.2_min.js"></script>
<link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/index.css"/>
<script src="/WebYiZhi/Template/Home/Js/Chart.js"></script>
<script src="/WebYiZhi/Template/Home/Js/Chart-1.0.1-beta.4.js"></script>
<script src="/WebYiZhi/Template/Home/Js/index.js"></script>
<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/My97DatePicker/WdatePicker.js"></script>

    <style>
        .red{
            color: red;
        }
    </style>
</head>
<body>
<!--头部开始-->
<div  class="header">
    <div class="header_box">
        <div class="header_cont">
            <div class="head_l lt">您好！欢迎来到移植网</div>
            <div class="head_r rt">
                <span><a href="JavaScript:;"><?php echo ($realname); ?></a>医生，欢迎您回来！</span>
                <span><a href="JavaScript:;">消息</a></span>
                <span><b></b><a href="<?php echo U('DoctorInfo/info');?>">个人中心</a></span>
                <span><a href="<?php echo U('DoctorInfo/loginout');?>">退出</a></span>
            </div>
        </div>
    </div>
</div>
<!--头部结束-->
<div class="p_main">
    <div class="p_tab row">
        <div class="p_switch col-xs-2">
            <p>首页/患者列表</p>
            <ul class="p_ul">
                <?php if(is_array($column)): $i = 0; $__LIST__ = $column;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li><a href="<?php echo U('DoctorInfo/index',array('genre'=>2,'type'=>$v['id']));?>" <?php if($_REQUEST['type'] == $v['id']): ?>class="p_txt"<?php endif; ?>><?php echo ($v['title']); ?><b class="rt"></b></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
                <li><a href="<?php echo U('DoctorInfo/index',array('genre'=>2,'add'=>1));?>" <?php if($_REQUEST['add'] == 1): ?>class="p_txt"<?php endif; ?>>添加患者<b class="rt"></b></a></li>
            </ul>
        </div>
        <div class="p_cont col-xs-10">
            <p>
                <?php if(is_array($column)): $i = 0; $__LIST__ = $column;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i; if($_REQUEST['type'] == $v['id']): ?><span class="lf"><?php echo ($v['title']); ?></span><?php endif; endforeach; endif; else: echo "" ;endif; ?>
                <?php if($_GET['add']): ?>添加患者<?php endif; ?>
                <span class="rt"  <?php if($_GET['add']): ?>style="display:none"<?php endif; ?>> <input type="text"/><input type="submit"/></span>
            </p>
            <div class="p_cont_cage">
                <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><div class="">
                        <div class="p_change_box row">
                            <div  class="col-xs-2 prow_2"><img src="/WebYiZhi/Template/Home/Img/00b.jpg" alt=""/></div>
                            <div class="col-xs-7 prow_7">
                                <ul>
                                    <li><span>姓名:</span><a href="javascript:;"><?php echo ($v['patientid']['realname']); ?></a></li>
                                    <li><span>性别:</span><a href="javascript:;"> <?php if($v['sex'] == 1): ?>男<?php else: ?>女<?php endif; ?></a></li>
                                    <li><span>年龄:</span><a href="javascript:;"><?php echo birthday2($v['patientid']['birthday']);?></a></li>
                                    <li><span>备注:</span><a href="javascript:;">该患者血糖较高。糖尿病肾病是糖尿病常见的并发症,是糖尿病全身性微血管病变表现之一。</a></li>
                                </ul>
                            </div>
                                <div class="col-xs-3 prow_3">
                                    <ul class="p3_btn">
                                  <?php if($_GET['type'] == 1): ?><li><a href="javascript:;" onclick="decline(<?php echo ($v['patientid']['id']); ?>,22)">拒绝</a></li>
                                        <li><a href="javascript:;" onclick="decline(<?php echo ($v['patientid']['id']); ?>,2)">通过</a></li>
                                        <li class="p3_btn_ul">
                                            <a href="javascript:;">分配</a>
                                            <div>
                                                <span></span>
                                                <ul>
                                                    <li><a href="javascript:;" onclick="decline(<?php echo ($v['patientid']['id']); ?>,4)">特别关注</a></li>
                                                    <li><a href="javascript:;">设为共享病人</a></li>
                                                    <li><a href="javascript:;">分配</a></li>
                                                    <li><a type="button" class="btn"  data-toggle="modal"  id="test"   onclick="updates(<?php echo ($v['patientid']['id']); ?>)" data-target=".bs-example-modal-lg">终止随访</a></li>
                                                    <li><a href="javascript:;" onclick="decline(<?php echo ($v['patientid']['id']); ?>,3)">删除</a></li>
                                                </ul>
                                            </div>
                                        </li>
                                        <li><a href="<?php echo U('chatview',array('patientid'=>$v['patientid']['id']));?>" target="_blank">交流</a></li>
                                    <?php else: ?>
                                      <li class="p3_btn_ul">
                                          <a href="javascript:;">分配</a>
                                          <div>
                                              <span></span>
                                              <ul>
                                                  <li><a href="javascript:;" onclick="decline(<?php echo ($v['patientid']['id']); ?>,4)">特别关注</a></li>
                                                  <li><a href="javascript:;">设为共享病人</a></li>
                                                  <li><a href="javascript:;">分配</a></li>
                                                  <li><a type="button" class="btn"  data-toggle="modal"  id="test"   onclick="updates(<?php echo ($v['patientid']['id']); ?>)" data-target=".bs-example-modal-lg">终止随访</a></li>
                                                  <li><a href="javascript:;" onclick="decline(<?php echo ($v['patientid']['id']); ?>,3)">删除</a></li>
                                              </ul>
                                          </div>

                                      </li>
                                      <li><a href="<?php echo U('chatview',array('patientid'=>$v['patientid']['id']));?>" target="_blank">交流</a></li><?php endif; ?>
                                    </ul>
                                </div>
                        </div>
                    </div><?php endforeach; endif; else: echo "" ;endif; ?>
                 <?php if($_GET['type']): ?><div class="page"><?php echo ($page); ?></div><?php endif; ?>
                <?php if($_GET['add']): ?><div class="p_change">
                        <form  id="death" >
                            <div class="row">
                                <div class="form-group col-xs-6">
                                    <label class="col-xs-3 control-label"><span class="red">*</span>患者姓名：</label>
                                    <div class="col-xs-7">
                                        <input type="text" class="form-control"  name="realname" autocomplete="off" placeholder="请输入患者姓名"  datatype="*" sucmsg="验证成功">
                                    </div>
                                    <div class="col-xs-2">

                                    </div>
                                </div>
                                <div class="form-group col-xs-6">
                                    <label class="col-xs-3 control-label"><span class="red">*</span>性别：</label>
                                    <div class="col-xs-7">
                                        <select class="select form-control" size="1" name="sex" datatype="*" sucmsg="验证成功">
                                                  <option value="">请选择</option>
                                                  <option value="0">女</option>
                                                <option value="1" >男</option>
                                         </select>
                                    </div>
                                    <div class="col-xs-2">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group col-xs-6">
                                    <label class="col-xs-3 control-label">出生日期：</label>
                                    <div class="col-xs-7">
                                        <input type="text" class="form-control"  name="birthday" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" autocomplete="off" placeholder="请输入"  value="">
                                    </div>
                                </div>
                                <div class="form-group col-xs-6">
                                    <label class="col-xs-3 control-label">联系地址：</label>
                                    <div class="col-xs-7">
                                        <input type="text" class="form-control" autocomplete="off" placeholder="请输入" name="address">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group col-xs-6">
                                    <label class="col-xs-3 control-label"><span class="red">*</span>血型：</label>
                                    <div class="col-xs-7">
                                        <select class="select form-control" size="1" name="bloodid" datatype="*" sucmsg="验证成功" >
                                            <option value="" selected="" disabled="disabled">请选择</option>
                                            <?php $_result=getLists(bloodtypeinfo);if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v["id"]); ?>"><?php echo ($v["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                        </select>
                                    </div>
                                    <div class="col-xs-2">

                                    </div>
                                </div>
                                <?php $type=getLists(kidneysourcetype);?>
                                <div class="form-group col-xs-6">
                                    <label class="col-xs-3 control-label"><span class="red">*</span>器官来源：</label>
                                    <div class="col-xs-7">
                                        <select class="select form-control" size="1" name="sourceid" datatype="*" sucmsg="验证成功">
                                            <option value="" selected="" disabled="disabled">请选择</option>
                                            <?php $_result=getLists(kidneysourcetype);if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v["id"]); ?>"><?php echo ($v["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                        </select>
                                    </div>
                                    <div class="col-xs-2" >

                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group col-xs-6">
                                    <label class="col-xs-3 control-label">患病时长：</label>
                                    <div class="col-xs-7">
                                        <input type="text" class="form-control" autocomplete="off" placeholder="请输入">
                                    </div>
                                </div>
                                <div class="form-group col-xs-6">
                                    <label class="col-xs-3 control-label"><span class="red">*</span>手术时间：</label>
                                    <div class="col-xs-7">
                                        <input type="text" class="form-control"  name="operationtime" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" autocomplete="off" placeholder="请输入"  value="" datatype="*" sucmsg="验证成功">
                                    </div>
                                    <div class="col-xs-2" >

                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group col-xs-6">
                                    <label class="col-xs-3 control-label"><span class="red">*</span>手术医院：</label>
                                    <div class="col-xs-7">
                                            <select class="select form-control" size="1" name="hospitalid" datatype="*" sucmsg="验证通过">
                                                <option value="" selected="" disabled="disabled">请选择</option>
                                                <?php $_result=getLists(hospitalinfo);if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v["id"]); ?>"><?php echo ($v['name']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                            </select>
                                    </div>
                                    <div class="col-xs-2">
                                    </div>
                                </div>
                                <div class="form-group col-xs-6">
                                    <label class="col-xs-3 control-label"><span class="red">*</span>同供体患者：</label>
                                    <div class="col-xs-7">
                                        <input type="text" class="form-control" autocomplete="off" placeholder="请输入" name="commonid" datatype="*" sucmsg="验证通过">
                                    </div>
                                    <div class="col-xs-2">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <!--<div class="form-group col-xs-6">-->
                                    <!--<label class="col-xs-3 control-label">联系电话：</label>-->
                                    <!--<div class="col-xs-7">-->
                                        <!--<input type="text" class="form-control" autocomplete="off" placeholder="请输入" name="phone">-->
                                    <!--</div>-->
                                <!--</div>-->
                            </div>
                            <div class="row p_submit">
                                <div class="col-xs-offset-4 col-xs-2"> <input type="submit"  value="提交"/></div>
                                <div class="col-xs-offset-1 col-xs-2" id="matching"  style="display: none"><input type="button" onclick="showIframe('进行配型信息','<?php echo U('Index/matching',array('id'=>$data['id']));?>','1050','900')" value="进行配型信息"/></div>
                            </div>
                        </form>
                    </div><?php endif; ?>
            </div>
        </div>
        <form id="fellowupStop">
            <div class="modal fade bs-example-modal-lg" tabindex="-1" id="fellow" role="dialog" aria-labelledby="myLargeModalLabel">
                <div class="modal-dialog modal-lg" role="document">
                    <div class="modal-content">
                        <div class="modal-header  z_tlt">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title text-center">终止随访</h4>
                        </div>
                        <input type="text" class="form-control" autocomplete="off" id="userid"  name="userid" placeholder="请输入" >
                        <div class="modal-body">
                            <form class="z_form" action="">
                                <div class="row">
                                    <div class="form-group col-xs-12">
                                        <label class="z_txt col-xs-offset-3 col-xs-3 control-label">选择终止随访原因：</label>
                                        <div class="col-xs-4">
                                            <select name="stoptypeid" id="stoptypeid">
                                                <option value="" selected="" disabled="disabled">请选择</option>
                                                <?php $_result=getLists(fellowupstoptype);if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v["id"]); ?>"><?php echo ($v["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                            </select>
                                        </div>
                                        <div  class="col-xs-4">

                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="z_txt z_btm col-xs-offset-3 col-xs-3">自定义终止随访原因：</div>
                                </div>
                                <div class="row">
                                    <textarea class="col-xs-offset-3 col-xs-6" cols="20" name="description" rows="10" placeholder="请输入终止随访原因"></textarea>
                                </div>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-danger" data-dismiss="modal">取消</button>
                            <button type="button" class="btn btn-success"  onclick="fellowupStop()">确定</button>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
</div>
</div>

<!--尾部开始-->
<!--尾部开始-->
<div class="footer">
    <div class="navbox">
        <ul>
            <li><a href="<?php echo U('DoctorInfo/index',array('genre'=>1));?>" <?php if($_GET['genre'] == 1): ?>class="footer_txt"<?php endif; ?> <?php if(!$_GET['genre']): ?>class="footer_txt"<?php endif; ?>>首页</a></li>
            <li><a href="<?php echo U('DoctorInfo/index',array('genre'=>2,'type'=>1));?>" <?php if($_GET['genre'] == 2): ?>class="footer_txt"<?php endif; ?>>我的患者</a></li>
            <li><a href="<?php echo U('DoctorInfo/index',array('genre'=>3));?>" <?php if($_GET['genre'] == 3): ?>class="footer_txt"<?php endif; ?>>社区资讯</a></li>
            <li><a href="<?php echo U('DoctorInfo/index',array('genre'=>4));?>" <?php if($_GET['genre'] == 4): ?>class="footer_txt"<?php endif; ?>>个人中心</a></li>
        </ul></div>
    <div class="footer_cont">
        <p>Copyright © 2008-2014 Change360.cn All Rights Reserved 陕西类星体信息科技有限公司</p>
        <p> 地址：陕西省西安市高新区高新一路正信大厦A座204室</p>
    </div>
</div>
<!--尾部结束-->
<!--</footer>-->
<!--<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/Validform/5.3.2/Validform.min.js"></script>-->
<!--<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/jquery.form/3.46.0/jquery.form.js"></script>-->
<!--<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/layer/2.1/layer.js"></script>-->
<!--<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/layer/2.1/extend/layer.ext.js"></script>-->
<!--<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/js/H-ui.js"></script>-->
<!--<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/js/H-ui.admin.js"></script>-->

<!--<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/ueditor/1.4.3/ueditor.config.js"></script>-->
<!--<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>-->
<!--<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>-->
<!--<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/icheck/jquery.icheck.min.js"></script>-->

<!--<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/laypage/1.2/laypage.js"></script>-->
<!--<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/My97DatePicker/WdatePicker.js"></script>-->
<!--<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/jquery.cookie/jquery.cookie.js"></script>`-->
<script type="text/javascript" src="/WebYiZhi/Template/Home/Js/common.js"></script>
<!--<script type="text/javascript" src="/WebYiZhi/Template/Home/Js/jquery.dataTables.min.js"> </script>-->
<!--<script  type="text/javascript"  src="/WebYiZhi/Template/Home/Js/info.js"></script>-->

<!--尾部结束-->
</body>
<script>
    $("#death").Validform({
        tiptype:2,
        callback:function () {
            $.ajax({
                url:"<?php echo U('deathpatient');?>",
                data:$('#death').serialize(),
                type:"Post",
                dataType:"json",
                success:function (data) {
                    if(data.status==1){
                        layer.msg(data.msg,{time: 1000}, function () {$("#matching").show();});
                    }else{
                        layer.msg(data.msg,{time: 1000});
                    }
                },
                error:function () {
                    layer.msg('登陆失败，请刷新页面尝试再一次登录');
                }
            });
            return false;
        }
    });
    function decline($patientid,$type) {
        if($type==22){
            var content="你确定要拒绝该患者吗？";
        }else if($type==2){
            content="你确定要接受该患者吗？";
        }else if ($type==4){
            content="你确定要将该患者设为特别关注吗？";
        }else if($type==3){
            content="你确定要删除该患者吗？";
        }
        layer.open({
              anim: 6,
              content:content ,
              btn: ['确定', '否'],
            yes: function(){
                $.ajax({
                    url:"<?php echo U('DoctorInfo/revieweds');?>",
                    data:{
                        patient:$patientid,
                        type:$type
                    },
                    type:"Post",
                    dataType:"json",
                    success:function (data) {
                        if(data.status==1){
                            layer.msg(data.msg,{time: 1000}, function () { window.location.reload();});
                        }else{
                            layer.msg('操作失败');
                        }
                    },
                    error:function (err) {
                        layer.msg('服务器异常，请稍后在操作！');

                    }
                })
            },
            cancel: function(){
                //右上角关闭回调
            }
        });
    }
    /**
     * 获取到患者id嵌入模态窗
     * @param $id
     */
     function updates($id) {
           $("#userid").val($id);
      }
    /**
     * 提交终止随访
     */
    function fellowupStop() {
        if($("#stoptypeid option:selected").val()){
            $.ajax({
                url:"<?php echo U('fellowupStop');?>",
                data:$('#fellowupStop').serialize(),
                type:"Post",
                dataType:"json",
                success:function (data) {
                    if(data.status==1){
                        layer.msg(data.msg,{time: 1000}, function () {
                            $('#fellow').modal('hide');
                            window.location.reload();
                        });
                    }else{
                        layer.msg(data.msg,{time: 1000});
                    }
                },
                error:function () {
                    layer.msg('登陆失败，请刷新页面尝试再一次登录');
                }
            });
          }else{
            layer.msg('请选择随访终止原因',{time:1000});
          }
        }
</script>
</html>